package com.upb.webserver.common.constant;

/**
 * Http request tools
 */
public class RestConstant {

    public static final String FISCO_CHAIN_MANAGER_URL_FORMAT = "http://%1s/WeBASE-Chain-Manager/%2s";
    public static final String FABRIC_CHAIN_MANAGER_URL_FORMAT = "http://%1s/Hyperledger-Chain-Manager/%2s";
    public static final String FABRIC_STAT_URL_FORMAT = "http://%1s/Hyperledger-Stat/%2s";
    public static final String FISCO_STAT_URL_FORMAT = "http://%1s/WeBASE-Stat/%2s";
    public static final String FABRIC_DATA_FETCHER_URL_FORMAT = "http://%1s/Hyperledger-Data/%2s";
    public static final String FISCO_DATA_FETCHER_URL_FORMAT = "http://%1s/WeBASE-Data/%2s";


    //server name
    public static final String SERVER_NAME_WEBASE_CHAIN_MANAGER = "WeBASE-Chain-Manager";
    public static final String SERVER_NAME_WEBASE_STAT = "WeBASE-Stat";
    public static final String SERVER_NAME_WEBASE_DATA_FETCHER = "WeBASE-Data";
    public static final String SERVER_NAME_HYPERLEDGER_CHAIN_MANAGER = "Hyperledger-Chain-Manager";
    public static final String SERVER_NAME_HYPERLEDGER_STAT = "Hyperledger-Stat";
    public static final String SERVER_NAME_HYPERLEDGER_DATA_FETCHER = "Hyperledger-Data";


    /**
     * WeBASE-Chain-Manager request uri
     */
    public static final String URI_WEBASE_CHAIN_DEPLOY = "chain/deploy";
    public static final String URI_WEBASE_CHAIN_NEW = "chain/new";
    public static final String URI_WEBASE_CHAIN_DEPLOY_PROGRESS_FORMAT = "chain/deploy/progress?chainId=%1d";
    public static final String URI_WEBASE_CHAIN_GET_BY_ID = "chain/get/%s";
    public static final String URI_WEBASE_CHAIN_GET_ALL = "chain/all";
    public static final String URI_WEBASE_CHAIN_DELETE = "chain/%s";
    public static final String URI_WEBASE_CHAIN_IMAGE_TYPE_LIST = "chain/image/type";
    public static final String URI_WEBASE_CHAIN_HOST_LIST_INIT = "chain/initHostList";
    public static final String URI_WEBASE_CHAIN_ADD_NODE = "chain/addNode";

    public static final String URI_WEBASE_GROUP_GENERATE = "group/generate";
    public static final String URI_WEBASE_GROUP_NODE_LIST = "group/consensus/list/%s/%s";
    public static final String URI_WEBASE_GROUP_ADD_SEALER_ASYNC = "group/addSealerAsync";
    public static final String URI_WEBASE_GROUP_SET_CONSENSUS_STATUS = "group/setConsensusStatus";


    public static final String URI_WEBASE_USER_NEW = "user/newUser";
    public static final String URI_WEBASE_USER_LIST = "user/list/%s/%s/%s";
    public static final String URI_WEBASE_USER_PAGE = "user/page";

    public static final String URI_WEBASE_CONTRACT_SAVE = "contract/save";
    public static final String URI_WEBASE_CONTRACT_FIND_BY_ID = "contract/%d";
    public static final String URI_WEBASE_CONTRACT_SELECT = "contract/contractList";
    public static final String URI_WEBASE_CONTRACT_PAGE = "contract/page";
    public static final String URI_WEBASE_CONTRACT_DEPLOY = "contract/deployByContractId";
    public static final String URI_WEBASE_CONTRACT_DELETE = "contract/%d/%d/%d";
    public static final String URI_WEBASE_SEND_TRANSACTION = "trans/sendByContractId";
    public static final String URI_WEBASE_COMPILE_BY_CONTRACT_ID = "contract/compile/%d";

    public static final String URI_WEBASE_FRONT_LIST = "front/find";
    public static final String URI_WEBASE_FRONT_LIST_BY_IP = "front/listByIp";

    public static final String URI_WEBASE_NODE_ALL = "node/all";
    public static final String URI_WEBASE_NODE_LIST = "node/nodeList/%s/%s/1/100";
    public static final String URI_WEBASE_NODE_ID_LIST = "node/nodeIdList/%d/%d?agencyId=%d&nodeTypes=%s";
    public static final String URI_WEBASE_NODE_RECEIPT = "node/getTransactionReceipt/%1s/%2s/%3s/%4s";

    public static final String URI_WEBASE_DATAGROUP_TXNDAILY = "datagroup/txnDaily/%1s/%2s";
    public static final String URI_WEBASE_DATAGROUP_GENERAL = "datagroup/general/%1s/%2s";
    public static final String URI_WEBASE_DATAGROUP_NODELIST = "datagroup/nodeList/%1s/%2s/%3s/%4s";
    public static final String URI_WEBASE_DATAGROUP_BLOCKLIST = "datagroup/blockList/%1s/%2s/%3s/%4s";
    public static final String URI_WEBASE_DATAGROUP_TRANSLIST = "datagroup/transList/%1s/%2s/%3s/%4s";
    public static final String URI_WEBASE_DATAGROUP_TRANSINFO = "datagroup/transInfo/%1s/%2s/%3s";


    /**
     * Hyperledger-Chain-Manager request uri
     */
    public static final String URI_FABRIC_CHAIN_CREATE = "chain/create";
    public static final String URI_FABRIC_CHAIN_QUERY = "chain/query";
    public static final String URI_FABRIC_CHAIN_QUERY_NODES = "chain/query_nodes";
    public static final String URI_FABRIC_CHAIN_QUERY_FRONTS = "chain/query_fronts";
    public static final String URI_FABRIC_CHAIN_DELETE = "chain/remove";
    public static final String URI_FABRIC_CHAIN_CHECK_CHAIN_HOST = "chain/check_chain_hosts";
    public static final String URI_FABRIC_CHANNEL_CREATE = "channel/create";
    public static final String URI_FABRIC_CHAIN_CODE_SAVE = "chaincode/save";
    public static final String URI_FABRIC_CHAIN_CODE_ZIP_SAVE = "chaincode/save_zip";
    public static final String URI_FABRIC_CHAIN_CODE_LIST = "chaincode/list";
    public static final String URI_FABRIC_CHAIN_CODE_INSTALL = "chaincode/install";
    public static final String URI_FABRIC_CHAIN_CODE_INSTANTIATE = "chaincode/instantiate";
    public static final String URI_FABRIC_CHAIN_CODE_STATUS_QUERY = "chaincode/status";
    public static final String URI_FABRIC_CHAIN_CODE_CONTENT_QUERY = "chaincode/query_content";
    public static final String URI_FABRIC_CHAIN_CODE_DELETE = "chaincode/delete";
    public static final String URI_FABRIC_TRANSACTION_SEND = "transaction/send";
    public static final String URI_FABRIC_CHAIN_CODE_QUERY_EDORSEMENT_TYPES = "chaincode/query_edorsement_types";
    public static final String URI_FABRIC_MEMBER_REGISTER = "member/register";
    public static final String URI_FABRIC_MEMBER_LIST = "member/list";


    /**
     * WeBASE stat request uri
     */
    public static final String URI_FISCO_STAT_GROUP_BASIC_DATA = "data/groupBasicData";
    public static final String URI_FISCO_STAT_NODE_MONITOR = "data/metrics/nodeMonitor";
    public static final String URI_FISCO_STAT_SERVER_PERFORMANCE = "data/metrics/serverPerformance";


    /**
     * Hyperledger stat request uri
     */
    public static final String URI_FABRIC_STAT_PERFORMANCE_METRICS = "performance/metrics";
    public static final String URI_FABRIC_STAT_PERFORMANCE = "performance/list";
    public static final String URI_FABRIC_STAT_HEALTHZ = "healthz/list";
    public static final String URI_FABRIC_STAT_METRIC_PEER = "peer/list";
    public static final String URI_FABRIC_STAT_METRIC_ORDERER = "orderer/list";

    /**
     * WeBASE data fetcher request uri
     */
    public static final String URI_WEBASE_DATA_FETCHER_CHAIN_GENERAL = "chain/general";
    public static final String URI_WEBASE_DATA_FETCHER_CHAIN_ALL = "chain/all";
    public static final String URI_WEBASE_DATA_FETCHER_GROUP_LIST = "group/list";
    public static final String URI_WEBASE_DATA_FETCHER_GROUP_GENERAL = "group/general/%1s/%2s";
    public static final String URI_WEBASE_DATA_FETCHER_GROUP_TXNDAILY = "group/txnDaily/%1s/%2s";
    public static final String URI_WEBASE_DATA_FETCHER_GROUP_NODELIST = "group/nodeList/%1s/%2s/%3s/%4s";
    public static final String URI_WEBASE_DATA_FETCHER_GROUP_BLOCKLIST = "group/blockList/%1s/%2s/%3s/%4s";
    public static final String URI_WEBASE_DATA_FETCHER_GROUP_TRANSLIST = "group/transList/%1s/%2s/%3s/%4s";
    public static final String URI_WEBASE_DATA_FETCHER_GROUP_USERLIST = "group/userList/%1s/%2s/%3s/%4s";
    public static final String URI_WEBASE_DATA_FETCHER_GROUP_CONTRACTLIST = "group/contractList/%1s/%2s/%3s/%4s";
    public static final String URI_WEBASE_DATA_FETCHER_SEARCH_NORMAL = "search/normal";
    public static final String URI_WEBASE_DATA_FETCHER_SEARCH_KEYWORD = "search/keyword/%1s/%2s?keyword=%3s";
    public static final String URI_WEBASE_DATA_FETCHER_EVENT_EXPORT_ADD = "event/export/add";
    public static final String URI_WEBASE_DATA_FETCHER_EVENT_EXPORT_LIST = "event/export/list/%1s/%2s/%3s/%4s";
    public static final String URI_WEBASE_DATA_FETCHER_EVENT_EXPORT_UPDATE = "event/export/updateStatus";
    public static final String URI_WEBASE_DATA_FETCHER_EVENT_EXPORT_DELETE = "event/export/deleteById/%1s";
    public static final String URI_WEBASE_DATA_FETCHER_EVENT_INFO_LIST = "event/info/list";
    public static final String URI_WEBASE_DATA_FETCHER_OVERVIEW_TRANSLISTALL = "overview/transListAll/%1s/%2s/%3s/%4s";
    public static final String URI_WEBASE_DATA_FETCHER_OVERVIEW_TRANSCOUNTALL = "overview/transCountAll/%1s/%2s/%3s/%4s";
    public static final String URI_WEBASE_DATA_FETCHER_OVERVIEW_BLOCKCOUNTALL = "overview/blockCountAll/%1s/%2s/%3s/%4s";


    /**
     * Hyperledger data fetcher request uri
     */
    public static final String URI_HYPERLEDGER_DATA_FETCHER_DATA_GENERAL = "dataGeneral";
    public static final String URI_HYPERLEDGER_DATA_FETCHER_NETWORK_LIST = "networkList";
    public static final String URI_HYPERLEDGER_DATA_FETCHER_CHANNEL_LIST = "channelList/%1s";
    public static final String URI_HYPERLEDGER_DATA_FETCHER_CHANNEL_GENERAL = "channelGeneral/%1s/%2s";
    public static final String URI_HYPERLEDGER_DATA_FETCHER_TXNDAILY = "txnDaily/%1s/%2s";
    public static final String URI_HYPERLEDGER_DATA_FETCHER_ORDERERLIST = "ordererList/%1s/%2s/%3s";
    public static final String URI_HYPERLEDGER_DATA_FETCHER_PEERLIST = "peerList/%1s/%2s/%3s";
    public static final String URI_HYPERLEDGER_DATA_FETCHER_GROUP_ORGLIST = "orgList/%1s";
    public static final String URI_HYPERLEDGER_DATA_FETCHER_GROUP_BLOCKLIST = "blockList/%1s/%2s/%3s/%4s";
    public static final String URI_HYPERLEDGER_DATA_FETCHER_GROUP_TRANSLIST = "transList/%1s/%2s/%3s/%4s";
    public static final String URI_HYPERLEDGER_DATA_FETCHER_GROUP_USERLIST = "userList/%1s/%2s/%3s";
    public static final String URI_HYPERLEDGER_DATA_FETCHER_GROUP_CHAINCODELIST = "chaincodeList/%1s/%2s/%3s/%4s";
    public static final String URI_HYPERLEDGER_DATA_FETCHER_SEARCH_NORMAL = "search/normal";
    public static final String URI_HYPERLEDGER_DATA_FETCHER_SEARCH_KEYWORD = "search/keyword/%1s/%2s?keyword=%3s";
}
